#pragma once

#ifndef PARMELA_INPUT_H
#define PARMELA_INPUT_H

#include "basic_data.h"
#include <string>
#include <vector>

class parmela_distribution_input
{
public:
	parmela_distribution_input(void);
	~parmela_distribution_input(void);

	int write_input_0(phase_space_dist dist);
	int write_input_40(trace_space_dist dist);
};


namespace lattice
{
	class special_process_base
	{//base class that do nothing for special processing task, e.g. read from CST input, make SF calculation (vary cavity dimensions).
	public:
		virtual int process() {};
	};
	class parameter
	{//wrapper class for parameters, contain information of individual parameter of a namelist
	public:
		parameter() {value=0.0;is_int=false;is_ignore=true;};

		double value;
		std::string prm_string;//if this parameter is a variable, this will contain variable name. Or if a keyword is multiline, this should contain whole line e.g. file name for CELL
		std::string name;
		std::string description;
		bool is_int;
		bool is_ignore;
	};

	class keyword_base
	{//base class for keywords
	public:
		keyword_base() {special_process = nullptr;};

		std::string keyword;
		std::string alias_name; //this can be use for front end's input e.g. ALPHA then translate to EM3DFIELD for parmela, alias is primary for check the input and keyword is primary for write output (parmela input)
		std::vector<parameter> parameters;
		special_process_base* special_process;


		bool set_value(const std::vector<double>& value_list);//set parameters by values stored in a vector
		virtual bool set_value(const std::string& value_string);
		virtual std::string get_complete_line();//call special_process->process() then output input line.
	};

	class keyword_multiline : public keyword_base
	{
		bool set_value(const std::string& value_string);
		std::string get_complete_line();
	};


};



#endif //PARMELA_INPUT_H